package com.cp.service.impl;

import com.cp.dao.CodeSemanticChunkMapper;
import com.cp.repository.CodeSemanticChunk;
import com.cp.service.CodeSemanticChunkService;
import com.fasterxml.jackson.core.JsonFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CodeSemanticChunkServiceImpl implements CodeSemanticChunkService {

	@Autowired
	CodeSemanticChunkMapper codeSemanticChunkMapper;

	@Override
	public List<CodeSemanticChunk> getAll() {
		return codeSemanticChunkMapper.getAll();
	}

	@Override
	public List<CodeSemanticChunk> getBySemanticChunk(String semanticChunk) {
		return codeSemanticChunkMapper.getBySemanticChunk(semanticChunk);
	}

	@Override
	public CodeSemanticChunk getById(Integer id) {
		return codeSemanticChunkMapper.getById(id);
	}

	@Override
	public List<CodeSemanticChunk> getByConvictionId(Integer convictionId) {
		return codeSemanticChunkMapper.getByConvictionId(convictionId);
	}

	@Override
	public List<CodeSemanticChunk> getBySemanticChunkAndClassRelationId(String semanticChunk, Integer classRelationId) {
		return codeSemanticChunkMapper.getBySemanticChunkAndClassRelationId(semanticChunk, classRelationId);
	}

	@Override
	public List<CodeSemanticChunk> getByConvictionIdOrClassRelationId(Integer convictionId, Integer classRelationId, Integer pageNumber) {
		return codeSemanticChunkMapper.getByConvictionIdOrClassRelationId(convictionId, classRelationId, pageNumber);
	}
}
